﻿using System;
using System.Collections.Generic;
using MWS.Processing.Interfaces;

namespace MWS.Processing.Processors
{
    public abstract class DequeueProcessor<TRequest, TResponse> : QueueProcessor<TRequest, TResponse, TRequest>
        where TRequest : class
    {
        protected DequeueProcessor(Func<TRequest, TResponse> operation, IQueue<TRequest> queue) : base(operation, queue)
        {
        }

        public override IList<TRequest> GetRequests(int maxRequests)
        {
            return Queue.Dequeue(maxRequests);
        }
    }
}